/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2013
 */

package com.bbs.bean;

import javacommon.base.BaseEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.validator.constraints.Length;

/**
 * @author badqiu email:badqiu(a)gmail.com
 * @version 1.0
 * @since 1.0
 */


@Entity
@Table(name = "bbs_reply_info")
public class BbsReplyInfo extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "BbsReplyInfo";
	public static final String ALIAS_REPLY_ID = "回复id";
	public static final String ALIAS_REPLY_DETAIL = "回复内容";
	public static final String ALIAS_REPLY_TIME = "回复时间";
	public static final String ALIAS_REPLY_USERID = "回复用户id";
	public static final String ALIAS_REPLY_TITLEID = "回复帖子主题";
	public static final String ALIAS_REPLY_USERNAME = "回复用户名称";
	
	//date formats
	

	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * 回复id       db_column: reply_id 
     */ 	
	
	private java.lang.Integer replyId;
    /**
     * 回复内容       db_column: reply_detail 
     */ 	
	@Length(max=1000)
	private java.lang.String replyDetail;
    /**
     * 回复时间       db_column: reply_time 
     */ 	
	@Length(max=20)
	private java.lang.String replyTime;
    /**
     * 回复用户id       db_column: reply_userid 
     */ 	
	
	private java.lang.Integer replyUserid;
    /**
     * 回复帖子主题       db_column: reply_titleid 
     */ 	
	
	private java.lang.Integer replyTitleid;
    /**
     * 回复用户名称       db_column: reply_username 
     */ 	
	@Length(max=50)
	private java.lang.String replyUsername;
	//columns END


	public BbsReplyInfo(){
	}

	public BbsReplyInfo(
		java.lang.Integer replyId
	){
		this.replyId = replyId;
	}

	

	public void setReplyId(java.lang.Integer value) {
		this.replyId = value;
	}
	
	@Id @GeneratedValue(generator="custom-id")
	@GenericGenerator(name="custom-id", strategy = "increment")
	@Column(name = "reply_id", unique = true, nullable = false, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getReplyId() {
		return this.replyId;
	}
	
	@Column(name = "reply_detail", unique = false, nullable = true, insertable = true, updatable = true, length = 1000)
	public java.lang.String getReplyDetail() {
		return this.replyDetail;
	}
	
	public void setReplyDetail(java.lang.String value) {
		this.replyDetail = value;
	}
	
	@Column(name = "reply_time", unique = false, nullable = true, insertable = true, updatable = true, length = 20)
	public java.lang.String getReplyTime() {
		return this.replyTime;
	}
	
	public void setReplyTime(java.lang.String value) {
		this.replyTime = value;
	}
	
	@Column(name = "reply_userid", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getReplyUserid() {
		return this.replyUserid;
	}
	
	public void setReplyUserid(java.lang.Integer value) {
		this.replyUserid = value;
	}
	
	@Column(name = "reply_titleid", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getReplyTitleid() {
		return this.replyTitleid;
	}
	
	public void setReplyTitleid(java.lang.Integer value) {
		this.replyTitleid = value;
	}
	
	@Column(name = "reply_username", unique = false, nullable = true, insertable = true, updatable = true, length = 50)
	public java.lang.String getReplyUsername() {
		return this.replyUsername;
	}
	
	public void setReplyUsername(java.lang.String value) {
		this.replyUsername = value;
	}
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("ReplyId",getReplyId())
			.append("ReplyDetail",getReplyDetail())
			.append("ReplyTime",getReplyTime())
			.append("ReplyUserid",getReplyUserid())
			.append("ReplyTitleid",getReplyTitleid())
			.append("ReplyUsername",getReplyUsername())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getReplyId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof BbsReplyInfo == false) return false;
		if(this == obj) return true;
		BbsReplyInfo other = (BbsReplyInfo)obj;
		return new EqualsBuilder()
			.append(getReplyId(),other.getReplyId())
			.isEquals();
	}
}

